const webpack = require('webpack');

module.exports = app => {
  const { getWebpackConf } = app.config.dev;
  const compilar = webpack(getWebpackConf());
  app.use(require('koa-webpack-dev-middleware')(compilar, { publicPath: '/assets' }));
  app.use(require('koa-webpack-hot-middleware')(compilar, { path: '/__webpack_hmr' }));
};
